import java.util.Arrays;

public class Sort {
    public static void main(String[] args) {
        Sort sort = new Sort();
        int[] arr = {6,4,3,5,12,1};
        int[][] arr2 = new int[3][];
        int[] arr3 = new int[3];
//        System.out.println(Arrays.toString(sort.SelectSort(arr)));
//        System.out.println(Arrays.toString(sort.InsertSort(arr)));
//        System.out.println(arr2[1][0]);
        System.out.println(arr3[0]);
    }
    public int[] SelectSort(int[] arr) {

        for (int i= arr.length-1; i>=0 ; i-- ){
            int maxIndex = 0;
            for (int j =0;j<=i;j++){
                if (arr[maxIndex]<arr[j]){//从前面的数开始向后置换，
                    maxIndex = j;

                }
            }
            int temp = arr[i];
            arr[i] = arr[maxIndex];
            arr[maxIndex]=temp;

        }

        return arr;
    }
    public int[] InsertSort(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            int newindex = i;
            for(int j = i-1;j>=0;j--){
                if (arr[newindex]<arr[j])
                {
                    int temp = arr[newindex];
                    arr[newindex] = arr[j];
                    arr[j] = temp;
                    newindex --;
                }
            }

        }
return arr;
    }




}

